package tree;

/**
 *
 * @author honzee
 */
public class DimensionTree extends VyrazTree {
    
    private VyrazTree dSize;
    private VyrazTree dalsiDimenze;
    
    public DimensionTree(Position p1, Position p2, VyrazTree dalsiDimenze, VyrazTree dSize) {
        super(p1, p2);
        this.dSize = dSize;
        this.dalsiDimenze = dalsiDimenze;
    }

    @Override
    public String toString() {
        return String.format("Dimension %s: [%s, %s]", super.toString(), getDalsiDimenze(), getdSize());
    }

    @Override
    public Type getType() {
        return Type.INTEGER;
    }
    
     @Override
    public void accept(TreeVisitor visitor) {
        visitor.visitDimension(this);
    }

    @Override
    public void generate(Context ctx){
        getdSize().generate(ctx);
        getDalsiDimenze().generate(ctx);
    }

    /**
     * @return the dSize
     */
    public VyrazTree getdSize() {
        return dSize;
    }

    /**
     * @return the dalsiDimenze
     */
    public VyrazTree getDalsiDimenze() {
        return dalsiDimenze;
    }

    @Override
    public void setType(Type t) {
        
    }
}
